
<style>.footer.footer-home {display: none;}</style>
<div class="header">
    <a href="index.php?act=member" class="return iconfont icon-shangyiye"></a>
    <div class="header-title">我的收藏</div>
</div>
<div class="content-hot collection">
    <ul class="categoryson-title">
        <?php foreach ($output['cates'] as $cate): ?>
        <a href="index.php?act=member&op=collect&cate=<?php echo $cate['tc_id']; ?>"><li class="<?php echo $cate['tc_id'] == $output['curcate'] ? 'active' : ''; ?>"><?php echo $cate['tc_name']; ?></li></a>
        <?php endforeach; ?>
    </ul>
    <div class="commodity">
        <ul class="commodity-wraw">
            <?php if (!empty($output['tickets'])): ?>
            <?php foreach ($output['tickets'] as $ticket): ?>
            <a href="index.php?act=ticket&op=detail&tid=<?php echo $ticket['tk_id']; ?>">
            <li>
                <div class="commodity-img">
                    <img src="<?php echo $ticket['tk_thumb']; ?>" />
                </div>
                <div class="commodity-con">
                    <div class="commodity-title"><?php echo $ticket['tk_title']; ?></div>
                    <div class="commodity-brief"><?php echo $ticket['tk_subtitle']; ?></div>
                    <div class="commodity-grade">
                        <i class="iconfont icon-xing"></i>
                        <i class="iconfont icon-xing"></i>
                        <i class="iconfont icon-xing"></i>
                        <i class="iconfont icon-xing"></i>
                        <i class="iconfont icon-xing"></i>
                    </div>
                    <div class="commodity-price">
                        <?php list($int, $float) = explode('.',$ticket['tk_show_price']); ?>

                        <?php if ($ticket['tk_cate1'] == 2): ?>
                            <b><samp>¥</samp><?php echo $int; ?>.<samp><?php echo $float; ?>人均消费</samp></b>
                        <?php elseif ($ticket['tk_cate2'] == 10): ?>
                            <b><samp>免费畅游</samp></b>
                        <?php else: ?>
                            <b><samp>¥</samp><?php echo $int; ?>.<samp><?php echo $float; ?></samp></b><del>¥<?php echo $ticket['tk_market_price']; ?></del>
                        <?php endif; ?>

                        <div class="commodity-location"><?php echo $ticket['tk_city_name']; ?></div>
                    </div>
                </div>
                <div class="clear"></div>
            </li>
            </a>
            <?php endforeach; ?>
            <?php else: ?>
            <div class="empty">该分类下没有您的收藏</div>
            <?php endif; ?>
        </ul>
    </div>
    <div class="load hide">正在加载...</div>
</div>

<script>
    var allNum = <?php echo $output['TotalNum']; ?>,
        allPage = <?php echo $output['TotalPage']; ?>,
        curPage = 1;

    var is_scroll = false;
    //ajax加载数据
    function loadpage() {
        if(!is_scroll){
            return;
        }
        if (curPage < allPage) {
            curPage += 1;
        } else {
            $('.load').text('没有更多内容了').show();
            return;
        }
        $.get(location.href, {isajax:1,curpage:curPage},function(data){
            if(data){
                $(".commodity > ul").append(data);
                $('.load').hide();
            }
        });
    }
    $(window).scroll(function () {
        $('.load').show();
        is_scroll = true;
        //已经滚动到上面的页面高度
        var scrollTop = $(this).scrollTop();
        //页面高度
        var scrollHeight = $(document).height();
        //浏览器窗口高度
        var windowHeight = $(this).height();
        //此处是滚动条到底部时候触发的事件，在这里写要加载的数据，或者是拉动滚动条的操作
        if (scrollTop + windowHeight == scrollHeight) {
            loadpage();
        }
    });
</script>
